﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 微信模板消息发送日志
	/// </summary>
	[Table("WX_TplMsgLog")]
	public partial class WX_TplMsgLog
	{
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 模板消息ID
		/// </summary>
		[Column("TplID")]
		public int TplID { get; set; }

		/// <summary>
		/// 私有模板消息id
		/// </summary>
		[Column("TplCode")]
		[Display(Name = "用户openid")]
		[Required]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string TplCode { get; set; }

		/// <summary>
		/// 模板消息内容参数
		/// </summary>
		[Column("TplData")]
		[StringLength(1000, ErrorMessage = "{0}长度不能超过{1}")]
		public string TplData { get; set; }

		/// <summary>
		/// 应用ID
		/// </summary>
		[Column("AppID")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string AppID { get; set; }

		/// <summary>
		/// 用户openid
		/// </summary>
		[Column("OpenID")]
		[Display(Name = "用户openid")]
		[Required]
		[StringLength(128, ErrorMessage = "{0}长度不能超过{1}")]
		public string OpenID { get; set; }

		/// <summary>
		/// 模板跳转链接（海外帐号没有跳转能力）
		/// </summary>
		[Column("Url")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string Url { get; set; }

		/// <summary>
		/// 所需跳转到的小程序appid（该小程序appid必须与发模板消息的公众号是绑定关联关系，暂不支持小游戏）
		/// </summary>
		[Column("XCXID")]
		[StringLength(30, ErrorMessage = "{0}长度不能超过{1}")]
		public string XCXID { get; set; }

		/// <summary>
		/// 所需跳转到小程序的具体页面路径，支持带参数,（示例index?foo=bar），要求该小程序已发布，暂不支持小游戏
		/// </summary>
		[Column("XCXPagePath")]
		[StringLength(300, ErrorMessage = "{0}长度不能超过{1}")]
		public string XCXPagePath { get; set; }

		/// <summary>
		/// 模板消息发送状态
		/// </summary>
		[Column("RemindState")]
		public int RemindState { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }

	}
}
